﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NLBS.Data.Interface;
using NLBS.Entity;
namespace NLBS.Data.SqlDataService
{
    class UserService:IUserService
    {
        private DbProvider db
        {
            get
            {
                return DbProvider.Instance();
            }
        }
        #region IUserService Members

        public IList<User> GetUser()
        {
            return db.GetUser();
        }

        public User GetUserByID(int userID)
        {
            return db.GetUserByID(userID);
        }

        public User GetUserByName(string userName)
        {
            return db.GetUserByName(userName);
        }

        public void InsertUser(User user)
        {
            db.InsertUser(user);
        }

        public void UpdateUser(User user)
        {
            db.UpdateUser(user);
        }

        public void DeleteUser(int userID)
        {
            db.DeleteUser(userID);
        }

        public bool ValidateUser(string username, string password)
        {
           return db.ValidateUser(username, password);
        }

        #endregion
    }
}
